Passed
Pull Request — master (#75)
by Mark
03:15
created

LocalArrayAdapter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 6
dl 0
loc 20
rs 10
c 0
b 0
f 0

2 Functions

Rating   Name   Duplication   Size   Complexity  
A constructor 0 3 1
A load 0 5 2
1
import ConnectionAdapter from '../ConnectionAdapter.js';
2
import QueueMessage from '../Queue/QueueMessage.js';
3
4
/**
5
 *
6
 */
7
export default class LocalArrayAdapter extends ConnectionAdapter {
8
    /**
9
     *
10
     * @param options
11
     */
12
    constructor(options) {
13
        super(options);
14
    }
15
16
    /**
17
     *
18
     * @param model
19
     * @return {Promise<unknown>}
20
     */
21
    load(model) {
22
        return new Promise((resolve) => {
23
            resolve(new QueueMessage(model, 'insert', this.options[model.className()]));
24
        });
25
    }
26
}